package com.songyz.image.compress.utils;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * 全局异步任务线程持
 * 
 * @author songyz
 * @createTime 2023-03-18 09:07:51
 */
public class ExecPool {

    private static final ExecutorService pool = Executors.newFixedThreadPool(4);

    public static <T> Future<T> submit(Callable<T> task) {
        return pool.submit(task);
    }

    public static void submit(Runnable runnable) {
        pool.submit(runnable);
    }

}
